﻿using System.Collections.Generic;

namespace CodeMan.RabbitMq.Base.RabbitMq.Producer
{
    /// <summary>
    /// 生产者接口
    /// </summary>
    public interface IRabbitProducer
    {
        /// <summary>
        /// 发送消息
        /// </summary>
        /// <param name="exchange">交换机</param>
        /// <param name="routingKey">路由KEY</param>
        /// <param name="dto">发送消息对象</param>
        void Publish<T>(string exchange, string routingKey, T dto) where T : new();

        /// <summary>
        /// 发送消息
        /// </summary>
        /// <param name="exchange">交换机</param>
        /// <param name="routingKey">路由KEY</param>
        /// <param name="content">发送消息内容</param>
        void Publish(string exchange, string routingKey, string content);

        /// <summary>
        /// 发送消息
        /// </summary>
        /// <param name="exchange">交换机</param>
        /// <param name="routingKey">路由KEY</param>
        /// <param name="props">参数</param>
        /// <param name="dto">发送消息对象</param>
        void Publish<T>(string exchange, string routingKey, IDictionary<string, object> props, T dto) where T : new();

        /// <summary>
        /// 发送消息
        /// </summary>
        /// <param name="exchange">交换机</param>
        /// <param name="routingKey">路由KEY</param>
        /// <param name="props">参数</param>
        /// <param name="content">发送消息内容</param>
        void Publish(string exchange, string routingKey, IDictionary<string, object> props, string content);
    }
}